% This file creates and saves Figure 3a in 
% Replication_files\Figures\Figure3a.eps
clear

cd ../mat_files

load irfs_w_inertia_extended.mat

y_e_i=y_e;
c_e_i=c_e;
dy_e_i=dy_e;
q_e_i=q_e;
mu_e_i=mu_e;
pi_e_i=pi_e;
i_e_i=i_e;

load irfs_wo_inertia_extended.mat

fig1a=figure;

%output response

irf_y=subplot(2,4,1);
hold on
plot(1:20,y_e_i,'k','LineWidth',1);
plot(1:20,y_e,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
title(irf_y,'\fontsize{10}Output (Y)','fontweight','normal');
box(irf_y,'on');

%consumption response

irf_c=subplot(2,4,2);
hold on
plot(1:20,c_e_i,'k','LineWidth',1);
plot(1:20,c_e,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
title(irf_c,'\fontsize{10}Consumption (C)','fontweight','normal')
box(irf_c,'on');

%technology response

irf_z=subplot(2,4,3);
hold on
plot(1:20,z_a_e,'k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
title(irf_z,'\fontsize{10}Technology (Z^a)','fontweight','normal')
box(irf_z,'on');

%output growth response

irf_dy=subplot(2,4,4);
hold on
plot(1:20,dy_e_i,'k','LineWidth',1);
plot(1:20,dy_e,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
ylim([-0.08 0.12]);
title(irf_dy,'\fontsize{10}Output Growth (\DeltaY)','fontweight','normal')
box(irf_dy,'on');

%discount rate response

irf_q=subplot(2,4,5);
hold on
plot(1:20,q_e_i,'k','LineWidth',1);
plot(1:20,q_e,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
ylim([-0.12 0.18]);
title(irf_q,'\fontsize{10}Discount Rate (q)','fontweight','normal')
box(irf_q,'on');

%markup response

irf_mu=subplot(2,4,6);
hold on
plot(1:20,mu_e_i,'k','LineWidth',1);
plot(1:20,mu_e,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
ylim([-0.04 0.06]);
title(irf_mu,'\fontsize{10}Markup (\mu)','fontweight','normal')
box(irf_mu,'on');

% inflation
irf_pi=subplot(2,4,7);
hold on
plot(1:20,pi_e_i,'k','LineWidth',1);
plot(1:20,pi_e,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
title(irf_pi,'\fontsize{10}Inflation (\pi)','fontweight','normal')
box(irf_pi,'on');

% interest rate
irf_i=subplot(2,4,8);
hold on
plot(1:20,i_e_i,'k','LineWidth',1);
plot(1:20,i_e,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
title(irf_i,'\fontsize{10}Nominal Rate (i)','fontweight','normal')
box(irf_i,'on');


fig1a.PaperUnits='inches';
fig1a.PaperPosition=[0 0 7.5 3];

cd ../Figures
print('Figure_1a','-depsc','-tiff')

clear 
cd ../m_files